package com.hup.mouseIcon.view;

import com.hup.utils.swing.FrameUtil;
import com.hup.utils.swing.IconUtil;
import lombok.extern.log4j.Log4j2;

import javax.swing.*;


/**
 * 光标window:根据光标图片,构造的不规则的窗口
 * @author hugan
 * @date 2020/1/4
 */
@Log4j2
public class MouseWindow extends JWindow {

    public MouseWindow() {
        String imgPath = "/img/cursor.gif";
        ImageIcon imageIcon = IconUtil.getIcon(imgPath, "光标");

        add(new JLabel(imageIcon));
        pack();
        setLocationRelativeTo(null);
        setAlwaysOnTop(true);

        log.info("size={}", getSize());
        FrameUtil.setIrregular(this, imageIcon.getImage());
    }

}
